﻿package component.fileupload.listener;

//保存状态类
public class FileUploadStatus {
	private long totalSize = 0;// 总数据的大小
	private long bytesRead = 0;// 已读数据大小
	private long startTime = System.currentTimeMillis();// 开始读取的时间
	private String currentStatus = "none";// 默认的状态
	public static String completeStatus = "complete";// 完成的状态

	public long getTotalSize(){// 属性totalSize的get方法
		return totalSize;
	}

	public void setTotalSize(long totalSize) {
		this.totalSize = totalSize;
	}

	public long getBytesRead(){// 属性bytesRead的get方法
		return bytesRead;
	}

	public long getElapsedTimeInSeconds(){// 获得已经上传得时间
		return (System.currentTimeMillis() - startTime) / 1000;
	}

	public String getCurrentStatus(){// 属性currentStatus的get方法
		return currentStatus;
	}

	public void setCurrentStatus(String currentStatus) {
		this.currentStatus = currentStatus;
	}

	public void setBytesRead(long bytesRead) {
		this.bytesRead = bytesRead;
	}

	public void incrementBytesRead(int byteCount) {
		this.bytesRead += byteCount;
	}
}
